package com.twp.auth.config.auth;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Wither;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Data
@Component
@ConfigurationProperties(prefix = "auth")
public class AuthConfig {
    private String salt;
    private boolean isLogout;
    private String[] permitAll;

    private List<Client> clients;

    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    public static class Client{
        @Wither
        private int index;
        private String clientName;
        private String secret;
        private String[] authorizedGrantTypes;
        private String[] scopes;
        private int accessTokenValiditySeconds;
    }
}
